package com.hh.workflow.action;

import org.springframework.beans.factory.annotation.Autowired;

import com.hh.baseframework.exception.MessageException;
import com.hh.system.util.base.BaseAction;
import com.hh.system.util.model.ReturnModel;
import com.hh.workflow.service.impl.StartService;

@SuppressWarnings("serial")
public class ActionStart extends BaseAction {
	private String dataId;
	private String pdkey;
	@Autowired
	private StartService startService;

	public void queryPagingData() {
		this.getResultMap().putAll(
				startService.queryPagingData(this.getPageRange(), pdkey));
		this.returnResult();
	}

	public void start() {
		try {
			this.returnResult(startService.start(pdkey));
		} catch (MessageException e) {
			this.getResultMap().put("returnModel",
					new ReturnModel(e.getMessage()));
		}
		this.returnResult();
	}
	
	public void deleteByIds() {
		startService.deleteByIds(this.getIds());
	}
	
	public void end() {
		startService.end(this.getIds());
	}
	
	public void findWorkFlowByDataId() {
		this.returnResult(startService.findWorkFlowByDataId(dataId));
	}

	public String getDataId() {
		return dataId;
	}

	public void setDataId(String dataId) {
		this.dataId = dataId;
	}

	public String getPdkey() {
		return pdkey;
	}

	public void setPdkey(String pdkey) {
		this.pdkey = pdkey;
	}

}
